﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using UniversityStudentManagemnetSystem.DAO.DAL;
using UniversityStudentManagemnetSystem.DAO.DAL.Gateway;

namespace UniversityStudentManagemnetSystem.BLL
{
    public class DesignationManager
    {
        DesignationGateway designationGateway = new DesignationGateway();
        public bool SaveDesignation(Designation designation)
        {
            if (designationGateway.HasThisDesignationName(designation.DesignationName))
            {
                throw new Exception("This name already exit.");
            }
            else
            {
                return designationGateway.DesignationSave(designation);
            }
        }
        public List<Designation> GetDesignations()
        {
            return designationGateway.GetAllDesignation();
        }

        public DataTable GetAllEmployeeDesignations()
        {
            return designationGateway.GetAllEmployeeDesignations();
        }

        public DataTable GetAllOfficerDesignations()
        {
            return designationGateway.GetAllOfficerDesignations();
        }

    }
}